\section{What is a neural network ?}

	A neural network is a computational model based inspired from biological neuron model. It is composed of an interconnected group of artificial neurons which correspond to computation units. One of the goal of such a structure is to determine a classification quickly on a dataset. To be able to classify data, a neural network suddens a learning phase in which it changes its own structure to correct the possible error on output.\\
	
	\subsection{Structure of a neural network}
	
		\begin{figure}[H]
			\centering
			\includegraphics[scale=0.6]{img/schema_nn.png}
			\caption{Schema of a neural network} 
		\end{figure}

The network is organized in layers. There are three kind of layers : 
\begin{itemize}
\item Input layer : only one, the only way to get information from outside.
\item Hidden layer : one or more, the computation is mostly done in these one.
\item Output layer : only one, bring the solution to outside.
\end{itemize}

Input layer outputs are first hidden layer inputs, and last hidden layer outputs are output layer inputs.

Each neuron possesses one weight per input. This value corresponds to how much this input will influence this neuron. Each input value is weighted, but these weights are not supposed to be the same in each neuron. This is by updating those weights that neurons learn and are finally able to guess. 

Moreover the network is characterized by an activation function. It is used to calculate outputs and may be different for each neuron.

	\subsection{How does it work ?}
	
In our implementation, weights are initalized randomly in a range between $-0.5$ and $0.5$.
The activation function is the same for every neuron, the sigmoid, for simplicity.
\begin{equation}
f(t) = \frac{1}{1 + e^{-t}}
\end{equation}

The mecanism to guess emotion on a given image is the following : 
\begin{enumerate}
\item First, each neurons in the input layer receive all pixel values.
\item Then each neuron computes the corresponding weighted sum $\Sigma_{i\in input} w_ix_i$.
\item The output of sigmoid for this entry is computed.
\item This last value is taken as output for this neuron in next layer, and the same steps are done for this layer.
\end{enumerate}	

At the last layer there are four -- one for each kind of emotion -- neurons. The value of the output is supposed to be 1 if it represents this emotion, and 0 if it doesn't. As our algorithm is compound of continuous value -- not boolean -- the guessed answer is chosen as the maximum output.